require("../py/util");

Page({
    data: {
        content: "内容获取中..."
    },
    CopySubmit: function() {
        wx.setClipboardData({
            data: this.data.content,
            success: function() {
                wx.showToast({
                    title: "复制成功",
                    duration: 1e3
                }), wx.getClipboardData({
                    success: function(t) {}
                });
            }
        });
    },
    GetApi: function() {
        var t = this;
        wx.request({
            url: "https://api.oddfar.com/yl/q.php?c=1003&encode=text",
            method: "get",
            success: function(e) {
                var n = e.data.replace(/<br>/g, "\n");
                console.log(n), t.setData({
                    content: n
                });
            }
        });
    },
    ReplaceSubmit: function() {
        wx.showLoading({
            title: "正在生成中..."
        }), this.GetApi(), wx.hideLoading(1e3);
    },
    onLoad: function(t) {
        this.GetApi();
    },
    onShareAppMessage: function() {
        return {
            title: this.data.content
        };
    }
});